﻿//========================================================= 
/**@file SocketCmdDriver.h
 * @brief Socket设备驱动
 * 
 * @date 2017-10-30   22:19:05
 * @author Zhyioo 
 * @version 1.0
 */ 
//--------------------------------------------------------- 
#ifndef _LIBZHOUYB_SOCKETCMDDRIVER_H_
#define _LIBZHOUYB_SOCKETCMDDRIVER_H_
//--------------------------------------------------------- 
#include "../CommonCmdDriver.h"
//--------------------------------------------------------- 
namespace zhou_yb {
namespace application {
namespace driver {
//--------------------------------------------------------- 
/**
 * @brief Socket设备命令驱动
 * @date 2017-10-30 22:20:05
 */
class SocketCmdDriver : public CommonCmdDriver
{
protected:
    LoopStreamCmdAdapter _dev;
    Ref<IInteractiveTrans> _activeTrans;
public:
    SocketCmdDriver() : CommonCmdDriver()
    {
        _activeTrans = _dev;

        _RegisteIInteractiveTransCMD(SocketCmdDriver);
        _RegisteInterfaceCMD(SocketCmdDriver, IInteractiveTrans);
    }
    LC_CMD_INTERFACE_GETTER(IInteractiveTrans, _activeTrans);
    LC_CMD_METHOD(Open)
    {
        return true;
    }
    LC_CMD_METHOD(IsOpen)
    {
        return true;
    }
    LC_CMD_METHOD(Close)
    {
        return true;
    }
    LC_CMD_INTERACTIVETRANS(_dev);
};
//--------------------------------------------------------- 
} // nemespace driver
} // namespace application
} // namespace zhou_yb
//--------------------------------------------------------- 
#endif // _LIBZHOUYB_SOCKETCMDDRIVER_H_
//========================================================= 